package com.buddy.sds.auth.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.buddy.sds.auth.entity.SystemRole;
import com.buddy.sds.common.mybatis.RedisCache;
import org.apache.ibatis.annotations.*;

import java.util.List;
@Mapper
public interface ISystemRoleMapper extends BaseMapper<SystemRole> {

    @Select("select role_id,role_name from t_system_role where role_id in (select ur_role from  t_system_user_role where ur_user=#{user_id})")
    List<SystemRole> getRoleListByUser(String user_id);

    @Delete("delete from t_system_user_role where ur_role = #{id}")
    void deleteUserRelations(String id);

    @Delete("delete from t_system_role_permission where rp_role = #{id}")
    void deletePermissionRelations(String id);
}
